/**
 * Created with IntelliJ IDEA.
 * ClassName: Topic
 * Package: PACKAGE_NAME
 * Description:
 * User: fzykd
 *
 * @Author: LQH
 * Date: 2023-08-26
 * Time: 10:42
 */

public class Topic {
    public static void main(String[] args) {

        int result = test("12");
        System.out.println(result);
        //输出结果和顺序
        //test结束
        //1

        //在return之前 要把finally的代码执行了


    }

    private static int test(String s) {

        try {
            Integer.parseInt(s);
            return 1;
        }catch (NumberFormatException e){
            return -1;
        }finally {
            System.out.println("test结束");
        }


    }
}
